package gui;
import javax.swing.JPanel;
import javax.swing.*;
import java.awt.*;
import java.awt.Event;
import java.awt.EventQueue;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;

import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JList;
import javax.swing.JTextPane;
import javax.swing.JScrollPane;
import javax.swing.JTextField;

public class CurrentSemestersGUI extends JPanel{
	JLabel lblNewLabel;
	static JComboBox comboBox;
	JButton btnNewButton;
	JButton btnNext;
	JLabel lblNotValid;
	
	public CurrentSemestersGUI() {
		super();
		setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		initialize();
	}
	private void initialize() {
		this.setSize(900,600);
		this.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		lblNewLabel = new JLabel("Select the relevant course from the list and then click next");
		lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
		add(lblNewLabel);
		
		comboBox = new JComboBox();
		springLayout.putConstraint(SpringLayout.NORTH, comboBox, 169, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.WEST, comboBox, 250, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, comboBox, -358, SpringLayout.EAST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, lblNewLabel, -51, SpringLayout.NORTH, comboBox);
		springLayout.putConstraint(SpringLayout.EAST, lblNewLabel, 0, SpringLayout.EAST, comboBox);
		add(comboBox);
		
		btnNewButton = new JButton("Main Menu");
		springLayout.putConstraint(SpringLayout.WEST, btnNewButton, 50, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, btnNewButton, -121, SpringLayout.SOUTH, this);
		btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 13));
		add(btnNewButton);
		
		btnNext = new JButton("Next");
		springLayout.putConstraint(SpringLayout.NORTH, btnNext, 0, SpringLayout.NORTH, btnNewButton);
		springLayout.putConstraint(SpringLayout.WEST, btnNext, 427, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, btnNext, 0, SpringLayout.EAST, lblNewLabel);
		btnNext.setFont(new Font("Tahoma", Font.BOLD, 13));
		add(btnNext);
		
		lblNotValid = new JLabel("Invalid selection");
		springLayout.putConstraint(SpringLayout.EAST, lblNotValid, -33, SpringLayout.WEST, btnNext);
		springLayout.putConstraint(SpringLayout.SOUTH, comboBox, -256, SpringLayout.NORTH, lblNotValid);
		springLayout.putConstraint(SpringLayout.NORTH, lblNotValid, -4, SpringLayout.NORTH, btnNewButton);
		lblNotValid.setForeground(Color.RED);
		lblNotValid.setVisible(false);
		lblNotValid.setIcon(new ImageIcon(PrevSemestersGUI.class.getResource("/javax/swing/plaf/metal/icons/ocean/error.png")));
		add(lblNotValid);
		
	}
	public static JComboBox getComboBox() {
		return comboBox;
	}
}
